//
//  DLMachineFormTC.m
//  delongzhitou
//
//  Created by Mr.Wang on 2018/11/30.
//  Copyright © 2018 delongzhitou. All rights reserved.
//

#import "DLMachineFormTC.h"
#import "DLMachineModel.h"
#import "DLFormBgView.h"

@interface DLMachineFormTC()

@property (nonatomic, strong) DLFormBgView *formBgView;

@end

@implementation DLMachineFormTC

- (instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self layoutsubControls];
        self.backgroundColor = kDLMachineTableAndCellBgColor;
//        self.backgroundColor = kColorRGB(240, 240, 240);
//        self.backgroundColor = kColorRandom;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}
- (void) layoutsubControls {
    
    DLFormBgView *formBgView = [[DLFormBgView alloc] initWithFrame:CGRectMake(kMachineFormTCBgViewLeftMargin, kMachineFormControlEdgeInset, kScreenWidth - kMachineFormTCBgViewLeftMargin * 2,kMachineFormBgViewDefaultHeight - kMachineFormControlEdgeInset *2)];
    [self.contentView addSubview:formBgView];
    self.formBgView = formBgView;
}
- (void) setFormModel:(DLMachineModel *)formModel {
    _formModel = formModel;
    NSLog(@"图表-图表是否展开：%d-----%@", formModel.isFormShowAllData, formModel.resultDic[@"data"][@"pTitle"]);
    NSLog(@"图表-资讯是否展开：%d", formModel.isInfoShowAllData);
    self.formBgView.formBgViewModel = formModel;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
